home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume7 / nethack3 / patch5d < prev    next >
Encoding:
Text File  |  1989-11-08  |  58.7 KB  |  2,288 lines

  1. Subject:  v08i051:  NetHack3 -  display oriented dungeons & dragons (Ver. 3.0), Patch5d
  2. Newsgroups: comp.sources.games
  3. Approved: billr@saab.CNA.TEK.COM
  4.  
  5. Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu>
  6. Posting-number: Volume 8, Issue 51
  7. Archive-name: NetHack3/Patch5d
  8. Patch-To: NetHack3: Volume 7, Issue 56-93
  9.  
  10. #! /bin/sh
  11. # This is a shell archive.  Remove anything before this line, then unpack
  12. # it by saving it into a file and typing "sh file".  To overwrite existing
  13. # files, type "sh file -c".  You can also feed this as standard input via
  14. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  15. # will see the following message at the end:
  16. #        "End of archive 4 (of 6)."
  17. # Contents:  patches05d
  18. # Wrapped by billr@saab on Tue Oct 17 13:16:44 1989
  19. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  20. if test -f 'patches05d' -a "${1}" != "-c" ; then 
  21.   echo shar: Will not clobber existing file \"'patches05d'\"
  22. else
  23. echo shar: Extracting \"'patches05d'\" \(56241 characters\)
  24. sed "s/^X//" >'patches05d' <<'END_OF_FILE'
  25. X*** src/Old/allmain.c    Sun Oct 15 18:28:13 1989
  26. X--- src/allmain.c    Sat Oct 14 21:51:34 1989
  27. X***************
  28. X*** 22,27 ****
  29. X--- 22,47 ----
  30. X  #endif
  31. X  
  32. X      for(;;) {
  33. X+ #ifdef MACOS
  34. X+     if (!(moves % 20)) {
  35. X+         UnloadSeg(doapply);
  36. X+         UnloadSeg(initedog);
  37. X+         UnloadSeg(doeat);
  38. X+         UnloadSeg(doengrave);
  39. X+         UnloadSeg(doopen);
  40. X+         UnloadSeg(mattacku);
  41. X+         UnloadSeg(mklev);
  42. X+         UnloadSeg(attacktype);
  43. X+         UnloadSeg(dohelp);
  44. X+         UnloadSeg(dopray);
  45. X+         UnloadSeg(dorecover);
  46. X+         UnloadSeg(timeout);
  47. X+         UnloadSeg(setworn);
  48. X+         UnloadSeg(initterm);
  49. X+         UnloadSeg(done);
  50. X+         UnloadSeg(savebones);
  51. X+     }
  52. X+ #endif
  53. X          if(flags.move) {    /* actual time passed */
  54. X  
  55. X  #ifdef SOUNDS
  56. X***************
  57. X*** 149,160 ****
  58. X                      pushch(ch);
  59. X  # endif /* REDO */
  60. X              }
  61. X!             if(abort || monster_nearby())
  62. X  #else
  63. X!             if(monster_nearby())
  64. X  #endif
  65. X                  stop_occupation();
  66. X!             else if ((*occupation)() == 0)
  67. X                  occupation = 0;
  68. X  #ifdef MSDOS
  69. X              if (!(++occtime % 7))
  70. X--- 169,181 ----
  71. X                      pushch(ch);
  72. X  # endif /* REDO */
  73. X              }
  74. X!             if(abort || monster_nearby()) {
  75. X  #else
  76. X!             if(monster_nearby()) {
  77. X  #endif
  78. X                  stop_occupation();
  79. X!                 reset_eat();
  80. X!             } else if ((*occupation)() == 0)
  81. X                  occupation = 0;
  82. X  #ifdef MSDOS
  83. X              if (!(++occtime % 7))
  84. X*** src/Old/apply.c    Sun Oct 15 18:28:44 1989
  85. X--- src/apply.c    Sat Oct 14 19:20:37 1989
  86. X***************
  87. X*** 601,607 ****
  88. X                  u.utraptype = 0;
  89. X                  }
  90. X                  unsee();
  91. X!                 goto_level(dlevel+1, FALSE);
  92. X  #ifdef WALKIES
  93. X              }
  94. X  #endif
  95. X--- 601,607 ----
  96. X                  u.utraptype = 0;
  97. X                  }
  98. X                  unsee();
  99. X!                 goto_level(dlevel+1, FALSE, TRUE);
  100. X  #ifdef WALKIES
  101. X              }
  102. X  #endif
  103. X***************
  104. X*** 1111,1116 ****
  105. X--- 1111,1120 ----
  106. X       * moves, we've got to deal with decaying corpses...
  107. X       */
  108. X      if (!(corpse = floorfood("can", 1))) return;
  109. X+     if (corpse->oeaten) {
  110. X+         pline("You cannot tin something which is partly eaten.");
  111. X+         return;
  112. X+     }
  113. X      if ((corpse->corpsenm == PM_COCKATRICE)
  114. X  #ifdef POLYSELF
  115. X          && !resists_ston(uasmon)
  116. X*** src/Old/bones.c    Sun Oct 15 18:29:52 1989
  117. X--- src/bones.c    Sat Oct 14 21:54:44 1989
  118. X***************
  119. X*** 230,236 ****
  120. X--- 230,258 ----
  121. X  #ifdef MSDOS
  122. X      fd = open(bones, O_WRONLY | O_BINARY | O_CREAT | O_TRUNC, FCMASK);
  123. X  #else
  124. X+ # ifdef MACOS
  125. X+     {
  126. X+         Str255    fileName;
  127. X+         OSErr    er;
  128. X+         struct term_info    *t;
  129. X+         extern WindowPtr    HackWindow;
  130. X+         short    oldvolume;
  131. X+         
  132. X+         t = (term_info *)GetWRefCon(HackWindow);
  133. X+         (void)GetVol(&fileName,&oldvolume);
  134. X+         (void)SetVol(0L, t->system.sysVRefNum);
  135. X+         fileName[0] = (uchar)strlen(bones);
  136. X+         (void)strcpy((char *)&fileName[1],bones);
  137. X+         
  138. X+         if (er = Create(&fileName,0,CREATOR,BONES_TYPE))
  139. X+             SysBeep(1);
  140. X+         fd = open(bones,
  141. X+             O_WRONLY | O_BINARY | O_TRUNC | ((er) ? O_CREAT : 0));
  142. X+         (void)SetVol(0L, oldvolume);
  143. X+     }
  144. X+ # else
  145. X      fd = creat(bones, FCMASK);
  146. X+ # endif /* MACOS */
  147. X  #endif
  148. X      if(fd < 0) {
  149. X  #ifdef WIZARD
  150. X*** src/Old/decl.c    Sun Oct 15 18:30:46 1989
  151. X--- src/decl.c    Sun Oct 15 12:05:32 1989
  152. X***************
  153. X*** 60,66 ****
  154. X--- 60,70 ----
  155. X  #  endif
  156. X  #endif
  157. X  
  158. X+ #ifdef SMALLDATA
  159. X+ char *occtxt = 0;
  160. X+ #else
  161. X  char *occtxt = DUMMY;
  162. X+ #endif
  163. X  const char quitchars[] = " \r\n\033";
  164. X  const char vowels[] = "aeiouAEIOU";
  165. X  const char ynchars[] = "yn";
  166. X***************
  167. X*** 67,80 ****
  168. X  const char ynqchars[] = "ynq";
  169. X  const char ynaqchars[] = "ynaq";
  170. X  const char nyaqchars[] = "nyaq";
  171. X  char *HI = DUMMY, *HE = DUMMY, *AS = DUMMY, *AE = DUMMY, *CD = DUMMY;
  172. X      /* set up in termcap.c */
  173. X  int CO = 0, LI = 0;    /* set up in termcap.c: usually COLNO and ROWNO+3 */
  174. X  
  175. X  #ifdef TEXTCOLOR
  176. X  char *hilites[MAXCOLORS];    /* terminal escapes for the various colors */
  177. X  #endif
  178. X- 
  179. X  #ifdef MSDOS
  180. X  char hackdir[PATHLEN];        /* where rumors, help, record are */
  181. X  const char *configfile = "NetHack.cnf";    /* read by read_config_file() */
  182. X--- 71,89 ----
  183. X  const char ynqchars[] = "ynq";
  184. X  const char ynaqchars[] = "ynaq";
  185. X  const char nyaqchars[] = "nyaq";
  186. X+ 
  187. X+ #ifdef SMALLDATA
  188. X+ char *HI = 0, *HE = 0, *AS = 0, *AE = 0, *CD = 0;
  189. X+     /* set up in termcap.c */
  190. X+ #else
  191. X  char *HI = DUMMY, *HE = DUMMY, *AS = DUMMY, *AE = DUMMY, *CD = DUMMY;
  192. X      /* set up in termcap.c */
  193. X+ #endif
  194. X  int CO = 0, LI = 0;    /* set up in termcap.c: usually COLNO and ROWNO+3 */
  195. X  
  196. X  #ifdef TEXTCOLOR
  197. X  char *hilites[MAXCOLORS];    /* terminal escapes for the various colors */
  198. X  #endif
  199. X  #ifdef MSDOS
  200. X  char hackdir[PATHLEN];        /* where rumors, help, record are */
  201. X  const char *configfile = "NetHack.cnf";    /* read by read_config_file() */
  202. X***************
  203. X*** 129,135 ****
  204. X  coord doors[DOORMAX] = DUMMY;
  205. X  
  206. X  struct mkroom rooms[MAXNROFROOMS+1] = DUMMY;
  207. X! level_t level;        /* level map */
  208. X  struct trap *ftrap = 0;
  209. X  struct gold *fgold = 0;
  210. X  struct monst youmonst = DUMMY;    /* dummy; used as return value for boomhit */
  211. X--- 138,144 ----
  212. X  coord doors[DOORMAX] = DUMMY;
  213. X  
  214. X  struct mkroom rooms[MAXNROFROOMS+1] = DUMMY;
  215. X! dlevel_t level;        /* level map */
  216. X  struct trap *ftrap = 0;
  217. X  struct gold *fgold = 0;
  218. X  struct monst youmonst = DUMMY;    /* dummy; used as return value for boomhit */
  219. X***************
  220. X*** 196,202 ****
  221. X--- 205,215 ----
  222. X  
  223. X  struct obj *billobjs = 0;
  224. X  
  225. X+ #ifdef THINK_C
  226. X+ const char Black[] = "black";
  227. X+ #else
  228. X  const char black[] = "black";
  229. X+ #endif
  230. X  const char amber[] = "amber";
  231. X  #ifdef THEOLOGY
  232. X  const char golden[] = "golden";
  233. X***************
  234. X*** 207,213 ****
  235. X--- 220,230 ----
  236. X  const char silver[] = "silver";
  237. X  const char blue[] = "blue";
  238. X  const char purple[] = "purple";
  239. X+ #ifdef THINK_C
  240. X+ const char White[] = "white";
  241. X+ #else
  242. X  const char white[] = "white";
  243. X+ #endif
  244. X  
  245. X  const char nothing_happens[] = "Nothing happens.";
  246. X  const char thats_enough_tries[] = "That's enough tries!";
  247. X*** src/Old/do.c    Sun Oct 15 18:31:17 1989
  248. X--- src/do.c    Sun Oct 15 17:25:04 1989
  249. X***************
  250. X*** 246,265 ****
  251. X  register char *word;
  252. X  {
  253. X      if(obj->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL)){
  254. X!         You("cannot %s something you are wearing.",word);
  255. X          return(FALSE);
  256. X      }
  257. X      if (obj->otyp == LOADSTONE && obj->cursed) {
  258. X          obj->bknown = 1;
  259. X!         pline("For some reason, you cannot %s the stone%s!",
  260. X!             word,
  261. X!             plur((long)obj->quan));
  262. X          return(FALSE);
  263. X      }
  264. X  #ifdef WALKIES
  265. X      if (obj->otyp == LEASH && obj->leashmon != 0) {
  266. X!         pline ("The leash is tied around your %s.",
  267. X!             body_part(HAND));
  268. X          return(FALSE);
  269. X      }
  270. X  #endif
  271. X--- 246,268 ----
  272. X  register char *word;
  273. X  {
  274. X      if(obj->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL)){
  275. X!            if (*word)
  276. X!             You("cannot %s something you are wearing.",word);
  277. X          return(FALSE);
  278. X      }
  279. X      if (obj->otyp == LOADSTONE && obj->cursed) {
  280. X          obj->bknown = 1;
  281. X!         if (*word)
  282. X!             pline("For some reason, you cannot %s the stone%s!",
  283. X!                 word,
  284. X!                       plur((long)obj->quan));
  285. X          return(FALSE);
  286. X      }
  287. X  #ifdef WALKIES
  288. X      if (obj->otyp == LEASH && obj->leashmon != 0) {
  289. X!            if (*word)
  290. X!             pline ("The leash is tied around your %s.",
  291. X!                     body_part(HAND));
  292. X          return(FALSE);
  293. X      }
  294. X  #endif
  295. X***************
  296. X*** 412,418 ****
  297. X  #endif
  298. X          if (trap)
  299. X              pline("You jump into the trapdoor...");
  300. X!         goto_level(dlevel+1, !trap);
  301. X  #ifdef STRONGHOLD
  302. X          at_ladder = FALSE;
  303. X  #endif
  304. X--- 415,421 ----
  305. X  #endif
  306. X          if (trap)
  307. X              pline("You jump into the trapdoor...");
  308. X!         goto_level(dlevel+1, !trap, TRUE);
  309. X  #ifdef STRONGHOLD
  310. X          at_ladder = FALSE;
  311. X  #endif
  312. X***************
  313. X*** 473,482 ****
  314. X          if (levl[u.ux][u.uy].typ == LADDER) at_ladder = TRUE;
  315. X          goto_level(dlevel-1, 
  316. X              (dlevel-1 < stronghold_level || (at_ladder && 
  317. X!                dlevel-1 >= tower_level && dlevel-1 < tower_level+2)));
  318. X          at_ladder = FALSE;
  319. X  #else
  320. X!         goto_level(dlevel-1, (dlevel-1 <= medusa_level));
  321. X  #endif
  322. X  #ifdef WALKIES
  323. X      }
  324. X--- 476,486 ----
  325. X          if (levl[u.ux][u.uy].typ == LADDER) at_ladder = TRUE;
  326. X          goto_level(dlevel-1, 
  327. X              (dlevel-1 < stronghold_level || (at_ladder && 
  328. X!                dlevel-1 >= tower_level && dlevel-1 < tower_level+2)),
  329. X!                FALSE);
  330. X          at_ladder = FALSE;
  331. X  #else
  332. X!         goto_level(dlevel-1, (dlevel-1 <= medusa_level), FALSE);
  333. X  #endif
  334. X  #ifdef WALKIES
  335. X      }
  336. X***************
  337. X*** 484,496 ****
  338. X      return(1);
  339. X  }
  340. X  
  341. X  void
  342. X! goto_level(newlevel, at_stairs)
  343. X  register int newlevel;
  344. X! register boolean at_stairs;
  345. X  {
  346. X      register int fd;
  347. X      register boolean up = (newlevel < dlevel);
  348. X  
  349. X  #ifdef ENDGAME
  350. X      if(dlevel == ENDLEVEL) return;    /* To be on the safe side.. */
  351. X--- 488,569 ----
  352. X      return(1);
  353. X  }
  354. X  
  355. X+ 
  356. X+ static void
  357. X+ litter()
  358. X+ {
  359. X+     struct obj *otmp = invent, *nextobj;
  360. X+     int capacity = weight_cap();
  361. X+ 
  362. X+     while (otmp) {
  363. X+         nextobj = otmp->nobj;
  364. X+         if ((otmp != uball) && (rnd(capacity) <= otmp->owt)) {
  365. X+             if (otmp == uwep)
  366. X+                 setuwep((struct obj *)0);
  367. X+             if ((otmp != uwep) && (canletgo(otmp, ""))) {
  368. X+                 Your("%s left behind on the stairs.",
  369. X+                      aobjnam(otmp, "get"));
  370. X+                 dropx(otmp);
  371. X+             }
  372. X+         }
  373. X+         otmp = nextobj;
  374. X+     }
  375. X+ }
  376. X+ 
  377. X+ boolean
  378. X+ drag_down()
  379. X+ {
  380. X+     boolean forward;
  381. X+     uchar dragchance = 3;
  382. X+ 
  383. X+ 
  384. X+     /* 
  385. X+         Assume that the ball falls forward if:
  386. X+ 
  387. X+         a) the character is wielding it, or
  388. X+         b) the character has both hands available to hold it (i.e. is 
  389. X+            not wielding any weapon), or 
  390. X+         c) (perhaps) it falls forward out of his non-weapon hand
  391. X+     */
  392. X+ 
  393. X+     forward = (!(carried(uball))? 
  394. X+           FALSE : ((uwep == uball) || (!uwep))? 
  395. X+               TRUE : (boolean)(rn2(3) / 2));
  396. X+ 
  397. X+     if (carried(uball)) 
  398. X+         You("lose your grip on the iron ball.");
  399. X+ 
  400. X+     if(forward) {
  401. X+         if(rn2(6)) {
  402. X+             You("get dragged downstairs by the iron ball.");
  403. X+             losehp(rnd(6), "iron ball accident");
  404. X+             return(TRUE);
  405. X+         }
  406. X+     } else {
  407. X+         if(rn2(2)) {
  408. X+             pline("The iron ball smacks into you!");
  409. X+             losehp(rnd(20), "iron ball collision");
  410. X+             dragchance -= 2;
  411. X+         } 
  412. X+         if(dragchance >= rnd(6)) {
  413. X+             You("get dragged downstairs by the iron ball.");
  414. X+             losehp(rnd(3), "iron ball accident");
  415. X+             return(TRUE);
  416. X+         }
  417. X+     }
  418. X+     return(FALSE);
  419. X+ }
  420. X+ 
  421. X  void
  422. X! goto_level(newlevel, at_stairs, falling)
  423. X  register int newlevel;
  424. X! register boolean at_stairs, falling;
  425. X  {
  426. X      register int fd;
  427. X      register boolean up = (newlevel < dlevel);
  428. X+     boolean stair_fall = (at_stairs && !up && ((inv_weight() + 5 > 0) || 
  429. X+                           Punished || Fumbling));
  430. X+     boolean stair_drag = FALSE;
  431. X  
  432. X  #ifdef ENDGAME
  433. X      if(dlevel == ENDLEVEL) return;    /* To be on the safe side.. */
  434. X***************
  435. X*** 560,566 ****
  436. X--- 633,663 ----
  437. X       */
  438. X      fd = open(lock, O_WRONLY | O_BINARY | O_CREAT | O_TRUNC, FCMASK);
  439. X  #else
  440. X+ # ifdef MACOS
  441. X+     {
  442. X+         Str255    fileName;
  443. X+         OSErr    er;
  444. X+         short    refNum;
  445. X+         struct term_info    *t;
  446. X+         extern WindowPtr    HackWindow;
  447. X+         
  448. X+         t = (term_info *)GetWRefCon(HackWindow);
  449. X+         fileName[0] = (char)strlen(lock);
  450. X+         (void)Strcpy((char *)&fileName[1],lock);
  451. X+         if (FSOpen(fileName, t->system.sysVRefNum, &refNum)) {
  452. X+                 if (er = Create(&fileName,t->system.sysVRefNum,
  453. X+                             CREATOR,LEVEL_TYPE))
  454. X+                     SysBeep(1);
  455. X+         } else {
  456. X+             (void)SetEOF(refNum,0L);
  457. X+             (void)FSClose(refNum);
  458. X+         }
  459. X+         SetVol(0L,t->system.sysVRefNum);
  460. X+         fd = open(lock,O_WRONLY | O_BINARY | ((er) ? O_CREAT : 0));
  461. X+     }
  462. X+ # else
  463. X      fd = creat(lock, FCMASK);
  464. X+ # endif /* MACOS */
  465. X  #endif
  466. X      if(fd < 0) {
  467. X          /*
  468. X***************
  469. X*** 592,597 ****
  470. X--- 689,702 ----
  471. X      }
  472. X  #endif
  473. X      if(Punished) unplacebc();
  474. X+     if (stair_fall) {
  475. X+ #ifdef STRONGHOLD
  476. X+             You("fall down the %s.",
  477. X+                 !at_ladder ? "stairs" : "ladder");
  478. X+ #else
  479. X+         You("fall down the stairs.");
  480. X+ #endif
  481. X+     }
  482. X      u.utrap = 0;                /* needed in level_tele */
  483. X      u.ustuck = 0;                /* idem */
  484. X      keepdogs();
  485. X***************
  486. X*** 646,652 ****
  487. X          if (fileinfo[dlevel].where != ACTIVE)
  488. X              swapin_file(dlevel);
  489. X  #endif
  490. X! #if defined(MSDOS) && !defined(TOS)
  491. X          if((fd = open(lock, O_RDONLY | O_BINARY)) < 0) {
  492. X  #else
  493. X          if((fd = open(lock,0)) < 0) {
  494. X--- 751,757 ----
  495. X          if (fileinfo[dlevel].where != ACTIVE)
  496. X              swapin_file(dlevel);
  497. X  #endif
  498. X! #if (defined(MSDOS) && !defined(TOS)) || defined(MACOS)
  499. X          if((fd = open(lock, O_RDONLY | O_BINARY)) < 0) {
  500. X  #else
  501. X          if((fd = open(lock,0)) < 0) {
  502. X***************
  503. X*** 701,721 ****
  504. X              u.uy = yupladder;
  505. X          }
  506. X  #endif
  507. X!         if(inv_weight() + 5 > 0 || Punished || Fumbling) {
  508. X! #ifdef STRONGHOLD
  509. X!             You("fall down the %s.",
  510. X!                   !at_ladder ? "stairs" : "ladder");
  511. X! #else
  512. X!             You("fall down the stairs.");
  513. X! #endif
  514. X              losehp(rnd(3), "fall");
  515. X-             if(Punished) {
  516. X-                 if(uwep != uball && rn2(3)) {
  517. X-                 pline("... and are hit by the iron ball.");
  518. X-                 losehp(rnd(20), "iron ball");
  519. X-                 }
  520. X-                 placebc(1);
  521. X-             }
  522. X              selftouch("Falling, you");
  523. X          }
  524. X          }
  525. X--- 806,824 ----
  526. X              u.uy = yupladder;
  527. X          }
  528. X  #endif
  529. X!         if(stair_fall) {
  530. X!             if (Punished) {
  531. X!                 if (stair_drag)
  532. X!                     litter();
  533. X!                 if (carried(uball)) {
  534. X!                     if (uwep == uball)
  535. X!                         setuwep((struct obj *)0);
  536. X!                     if (uwep != uball)
  537. X!                         freeinv(uball);
  538. X!                 }
  539. X!                 placebc(1);
  540. X!             } 
  541. X              losehp(rnd(3), "fall");
  542. X              selftouch("Falling, you");
  543. X          }
  544. X          }
  545. X***************
  546. X*** 743,759 ****
  547. X               levl[u.ux][u.uy].typ != CORR) || MON_AT(u.ux, u.uy));
  548. X          if(tryct >= 100)
  549. X          panic("goto_level: could not relocate player!");
  550. X!         if(Punished){
  551. X!         if(uwep != uball && !up /* %% */ && rn2(5)){
  552. X!             pline("The iron ball falls on your %s.",
  553. X!                 body_part(HEAD));
  554. X!             if (uarmh)
  555. X!                 Your("helmet doesn't help too much...");
  556. X!             losehp(rnd(25), "iron ball");
  557. X          }
  558. X          placebc(1);
  559. X          }
  560. X!         selftouch("Falling, you");
  561. X      }
  562. X      (void) inshop();
  563. X      initrack();
  564. X--- 846,875 ----
  565. X               levl[u.ux][u.uy].typ != CORR) || MON_AT(u.ux, u.uy));
  566. X          if(tryct >= 100)
  567. X          panic("goto_level: could not relocate player!");
  568. X!         if(Punished) {
  569. X!         if(falling) {
  570. X!             boolean gets_hit;
  571. X! 
  572. X!             gets_hit = (uwep == uball)? FALSE : (boolean)rn2(5);
  573. X!             if (carried(uball)) {
  574. X!                 pline("Startled, you drop the iron ball.");
  575. X!                 if (uwep == uball)
  576. X!                     setuwep((struct obj *)0);
  577. X!                 if (uwep != uball)
  578. X!                     freeinv(uball);
  579. X!             } 
  580. X!             if(gets_hit){
  581. X!                     pline("The iron ball falls on your %s.",
  582. X!                     body_part(HEAD));
  583. X!                 if (uarmh)
  584. X!                     Your("helmet doesn't help too much...");
  585. X!                 losehp(rnd(25), "iron ball");
  586. X!             }
  587. X          }
  588. X          placebc(1);
  589. X          }
  590. X!         if(falling)
  591. X!         selftouch("Falling, you");
  592. X      }
  593. X      (void) inshop();
  594. X      initrack();
  595. X*** src/Old/do_name.c    Sun Oct 15 18:31:51 1989
  596. X--- src/do_name.c    Wed Oct 11 17:14:47 1989
  597. X***************
  598. X*** 189,196 ****
  599. X  #endif
  600. X      if(lth) Strcpy(ONAME(otmp2), buf);
  601. X  
  602. X!     setworn((struct obj *)0, obj->owornmask);
  603. X!     setworn(otmp2, otmp2->owornmask);
  604. X  
  605. X      if (ininv) {
  606. X          /* do freeinv(obj); etc. by hand in order to preserve
  607. X--- 189,201 ----
  608. X  #endif
  609. X      if(lth) Strcpy(ONAME(otmp2), buf);
  610. X  
  611. X!     if (obj->owornmask) {
  612. X!         /* Note: dying by burning in Hell causes problems if you
  613. X!          * try doing this when owornmask isn't set.
  614. X!          */
  615. X!         setworn((struct obj *)0, obj->owornmask);
  616. X!         setworn(otmp2, otmp2->owornmask);
  617. X!     }
  618. X  
  619. X      if (ininv) {
  620. X          /* do freeinv(obj); etc. by hand in order to preserve
  621. X***************
  622. X*** 401,406 ****
  623. X--- 406,432 ----
  624. X  
  625. X      if(!strncmp(bp, "the ", 4)) bp += 4;
  626. X      Sprintf(buf, "the %s %s", adj, bp);
  627. X+     return(buf);
  628. X+ }
  629. X+ 
  630. X+ /* sometimes we don't want an article in front of definite names */
  631. X+ 
  632. X+ char *
  633. X+ a2_monnam(mtmp,adj)
  634. X+ register struct monst *mtmp;
  635. X+ register char *adj;
  636. X+ {
  637. X+     register char *bp = mon_nam(mtmp);
  638. X+ #ifdef LINT    /* static char buf[BUFSZ]; */
  639. X+     char buf[BUFSZ];
  640. X+ #else
  641. X+     static char buf[BUFSZ];
  642. X+ #endif
  643. X+ 
  644. X+     if(!strncmp(bp, "the ", 4))
  645. X+         Sprintf(buf, "the %s %s", adj, bp+4);
  646. X+     else
  647. X+         Sprintf(buf, "%s %s", adj, bp);
  648. X      return(buf);
  649. X  }
  650. X  
  651. X*** src/Old/do_wear.c    Sun Oct 15 18:32:16 1989
  652. X--- src/do_wear.c    Thu Oct  5 16:24:40 1989
  653. X***************
  654. X*** 1152,1160 ****
  655. X  #ifdef HARD
  656. X      boolean leftfall, rightfall;
  657. X  
  658. X!     leftfall = (uleft && !uleft->cursed && (!uwep || !uwep->cursed));
  659. X!     rightfall = (uright && !uright->cursed && (!uwep || !uwep->cursed
  660. X          || !bimanual(uwep)));
  661. X  #else
  662. X  #define leftfall uleft
  663. X  #define rightfall uright
  664. X--- 1152,1160 ----
  665. X  #ifdef HARD
  666. X      boolean leftfall, rightfall;
  667. X  
  668. X!     leftfall = (uleft && !uleft->cursed && (!uwep || !uwep->cursed
  669. X          || !bimanual(uwep)));
  670. X+     rightfall = (uright && !uright->cursed && (!uwep || !uwep->cursed));
  671. X  #else
  672. X  #define leftfall uleft
  673. X  #define rightfall uright
  674. X*** src/Old/dogmove.c    Sun Oct 15 18:33:08 1989
  675. X--- src/dogmove.c    Wed Oct 11 18:22:36 1989
  676. X***************
  677. X*** 261,272 ****
  678. X              niy = ny;
  679. X              chi = i;
  680. X               eatobj:
  681. X-             mtmp->meating =
  682. X-                 obj->quan * objects[obj->otyp].oc_delay;
  683. X              if(EDOG(mtmp)->hungrytime < moves)
  684. X                  EDOG(mtmp)->hungrytime = moves;
  685. X!             EDOG(mtmp)->hungrytime +=
  686. X!                 5*obj->quan * objects[obj->otyp].nutrition;
  687. X              mtmp->mconf = 0;
  688. X              if (mtmp->mtame < 20) mtmp->mtame++;
  689. X              if(cansee(nix,niy))
  690. X--- 261,291 ----
  691. X              niy = ny;
  692. X              chi = i;
  693. X               eatobj:
  694. X              if(EDOG(mtmp)->hungrytime < moves)
  695. X                  EDOG(mtmp)->hungrytime = moves;
  696. X!             /* Note: to get the correct percentage-eaten in case
  697. X!              * oeaten is set, use "obj->owt / obj->quan /
  698. X!              * base-weight".  It so happens that here we want to
  699. X!              * multiply by obj->quan, which thus cancels out.
  700. X!              * It is arbitrary that the pet takes the same length
  701. X!              * of time to eat as a human, but gets 5X as much
  702. X!              * nutrition.
  703. X!              */
  704. X!             if(obj->otyp == CORPSE) {
  705. X!                 mtmp->meating =
  706. X!                 (3 + (mons[obj->corpsenm].cwt >> 2))
  707. X!                 * obj->owt / mons[obj->corpsenm].cwt;
  708. X!                 EDOG(mtmp)->hungrytime += 5 * 
  709. X!                 mons[obj->corpsenm].cnutrit
  710. X!                 * obj->owt / mons[obj->corpsenm].cwt;
  711. X!             } else {
  712. X!                 mtmp->meating =
  713. X!                 objects[obj->otyp].oc_delay
  714. X!                 * obj->owt / objects[obj->otyp].oc_weight;
  715. X!                 EDOG(mtmp)->hungrytime += 5 *
  716. X!                 objects[obj->otyp].nutrition
  717. X!                 * obj->owt / objects[obj->otyp].oc_weight;
  718. X!             }
  719. X              mtmp->mconf = 0;
  720. X              if (mtmp->mtame < 20) mtmp->mtame++;
  721. X              if(cansee(nix,niy))
  722. X*** src/Old/eat.c    Sun Oct 15 18:34:06 1989
  723. X--- src/eat.c    Thu Oct 12 17:45:45 1989
  724. X***************
  725. X*** 3,10 ****
  726. X--- 3,15 ----
  727. X  /* NetHack may be freely redistributed.  See license for details. */
  728. X  
  729. X  #include    "hack.h"
  730. X+ /*#define DEBUG     /* uncomment to enable new eat code debugging */
  731. X  
  732. X+ static int fpostfx P((struct obj *));
  733. X+ static int cpostfx P((int));
  734. X+ 
  735. X  char corpsename[60];
  736. X+ char msgbuf[BUFSZ];
  737. X  
  738. X  /* hunger texts used on bottom line (each 8 chars long) */
  739. X  #define    SATIATED    0
  740. X***************
  741. X*** 27,32 ****
  742. X--- 32,57 ----
  743. X  
  744. X  static const char comestibles[] = { FOOD_SYM, 0 };
  745. X  
  746. X+ /* calculate x/y, rounding as appropriate */
  747. X+ 
  748. X+ static int
  749. X+ rounddiv(x, y)
  750. X+ int x, y;
  751. X+ {
  752. X+     int divsgn;
  753. X+     int r, m;
  754. X+ 
  755. X+     if (y == 0)
  756. X+         panic("division by zero in rounddiv");
  757. X+     divsgn = (x*y > 0) ? 1 : -1;
  758. X+     x = abs(x); y = abs(y);
  759. X+     r = x/y;
  760. X+     m = x%y;
  761. X+     if (2*m >= y)
  762. X+         r++;
  763. X+     return divsgn*r;
  764. X+ }
  765. X+ 
  766. X  void
  767. X  init_uhunger(){
  768. X      u.uhunger = 900;
  769. X***************
  770. X*** 44,55 ****
  771. X  #define    TTSZ    SIZE(tintxts)
  772. X  
  773. X  static struct {
  774. X!     struct obj *tin;
  775. X!     int usedtime, reqtime;
  776. X  } tin;
  777. X  
  778. X  static int
  779. X! Meatdone() {
  780. X      u.usym =
  781. X  #ifdef POLYSELF
  782. X          u.mtimedone ? uasmon->mlet :
  783. X--- 69,94 ----
  784. X  #define    TTSZ    SIZE(tintxts)
  785. X  
  786. X  static struct {
  787. X!     struct    obj *tin;
  788. X!     int    usedtime, reqtime;
  789. X  } tin;
  790. X  
  791. X+ static struct {
  792. X+     struct    obj *piece;    /* the thing being eaten, or last thing that
  793. X+                  * was partially eaten, unless that thing was
  794. X+                  * a tin, which uses the tin structure above */
  795. X+     int    usedtime,    /* turns spent eating */
  796. X+         reqtime;    /* turns required to eat */
  797. X+     int    nutrit,        /* total nutrition at beginning */
  798. X+         nmod;        /* coded nutrition per turn */
  799. X+     Bitfield(canchoke,1);    /* was satiated at beginning */
  800. X+     Bitfield(fullwarn,1);    /* have warned about being full */
  801. X+     Bitfield(eating,1);    /* victual currently being eaten */
  802. X+     Bitfield(doreset,1);    /* stop eating at end of turn */
  803. X+ } victual;
  804. X+ 
  805. X  static int
  806. X! Meatdone() {        /* called after mimicing is over */
  807. X      u.usym =
  808. X  #ifdef POLYSELF
  809. X          u.mtimedone ? uasmon->mlet :
  810. X***************
  811. X*** 59,70 ****
  812. X      return 0;
  813. X  }
  814. X  
  815. X  static int
  816. X! corpsefx(pm)
  817. X  register int pm;
  818. X  {
  819. X-     register int tmp = 0, tp = 0;
  820. X- 
  821. X      if ((pl_character[0]=='E') ? is_elf(&mons[pm]) : is_human(&mons[pm])) {
  822. X          You("cannibal!  You will be sorry for this!");
  823. X          Aggravate_monster |= INTRINSIC;
  824. X--- 98,247 ----
  825. X      return 0;
  826. X  }
  827. X  
  828. X+ /* Created by GAN 01/28/87
  829. X+  * Amended by AKP 09/22/87: if not hard, don't choke, just vomit.
  830. X+  * Amended by 3.  06/12/89: if not hard, sometimes choke anyway, to keep risk.
  831. X+  */
  832. X+ /*ARGSUSED*/
  833. X+ static void
  834. X+ choke(food)
  835. X+     register struct obj *food;
  836. X+ {
  837. X+     /* only happens if you were satiated */
  838. X+     if(u.uhs != SATIATED) return;
  839. X+ 
  840. X+     if (pl_character[0] == 'K' && u.ualigntyp == U_LAWFUL)
  841. X+         u.ualign--;    /* gluttony is unchivalrous */
  842. X+ 
  843. X+ #ifndef HARD
  844. X+     if (rn2(20)) {
  845. X+         You("stuff yourself and then vomit voluminously.");
  846. X+         morehungry(1000);    /* you just got *very* sick! */
  847. X+         vomit();
  848. X+     } else {
  849. X+ #endif
  850. X+         if(food) {
  851. X+             killer = singular(food);
  852. X+         } else
  853. X+             killer = "exuberant appetite";
  854. X+         You("choke over your food.");
  855. X+         You("die...");
  856. X+         done(CHOKING);
  857. X+ #ifndef HARD
  858. X+     }
  859. X+ #endif
  860. X+ }
  861. X+ 
  862. X+ static void
  863. X+ recalc_wt() {    /* modify object wt. depending on time spent consuming it */
  864. X+     int baseweight = weight(victual.piece);    /* weight of full item */
  865. X+ 
  866. X+ #ifdef DEBUG
  867. X+     pline("Old weight = %d", victual.piece->owt);
  868. X+     pline("Used time = %d, Req'd time = %d",
  869. X+         victual.usedtime, victual.reqtime);
  870. X+ #endif
  871. X+     if(victual.usedtime)
  872. X+         victual.piece->owt = (unsigned)rounddiv(
  873. X+                 baseweight * (victual.reqtime - victual.usedtime),
  874. X+                 victual.reqtime );
  875. X+ #ifdef DEBUG
  876. X+     pline("New weight = %d", victual.piece->owt);
  877. X+ #endif
  878. X+ }
  879. X+ 
  880. X+ void
  881. X+ reset_eat() {        /* called when eating interrupted by an event */
  882. X+ 
  883. X+     /* we only set a flag here - the actual reset process is done after
  884. X+      * the round is spent eating.
  885. X+      */
  886. X+     if(victual.eating && !victual.doreset) {
  887. X+ #ifdef DEBUG
  888. X+         pline("reset_eat...");
  889. X+ #endif
  890. X+         victual.doreset = TRUE;
  891. X+     }
  892. X+     return;
  893. X+ }
  894. X+ 
  895. X+ static struct obj *
  896. X+ touchfood(otmp)
  897. X+ register struct obj *otmp;
  898. X+ {
  899. X+     if(otmp->quan > 1) {
  900. X+ 
  901. X+         otmp = splitobj(otmp, (int)otmp->quan-1);
  902. X+ #ifdef DEBUG
  903. X+         pline("split object,");
  904. X+ #endif
  905. X+ 
  906. X+         otmp->oeaten = TRUE;
  907. X+         if(carried(otmp)) {
  908. X+         freeinv(otmp);
  909. X+         if(inv_cnt() >= 52)
  910. X+             dropy(otmp);
  911. X+         else
  912. X+             otmp = addinv(otmp); /* unlikely but a merge is possible */
  913. X+         }
  914. X+     } else
  915. X+         otmp->oeaten = TRUE;
  916. X+     return(otmp);
  917. X+ }
  918. X+ 
  919. X+ static void
  920. X+ do_reset_eat() {
  921. X+ 
  922. X+ #ifdef DEBUG
  923. X+     pline("do_reset_eat...");
  924. X+ #endif
  925. X+     victual.piece = touchfood(victual.piece);
  926. X+     recalc_wt();
  927. X+     victual.fullwarn = victual.eating = victual.doreset = 
  928. X+         victual.canchoke = FALSE;
  929. X+     stop_occupation();
  930. X+ }
  931. X+ 
  932. X  static int
  933. X! eatfood() {        /* called each move during eating process */
  934. X! 
  935. X!     if(!victual.eating) return(0);
  936. X!     if(victual.usedtime++ < victual.reqtime) {
  937. X!     /* You can only choke if you were satiated before you started
  938. X!      * eating.
  939. X!      */
  940. X!         if(victual.canchoke && u.uhunger >= 2000) choke(victual.piece);
  941. X! 
  942. X!         if(victual.nmod < 0)
  943. X!         lesshungry(-victual.nmod);
  944. X!         else if(victual.nmod > 0 && (victual.usedtime % victual.nmod))
  945. X!         lesshungry(1);
  946. X! 
  947. X!         if(victual.doreset) do_reset_eat();
  948. X!         return 1;    /* still busy */
  949. X!     } else {    /* done */
  950. X! 
  951. X!         register int tp;
  952. X! 
  953. X!         if(victual.piece->otyp == CORPSE)
  954. X!         tp = cpostfx(victual.piece->corpsenm);
  955. X!         else
  956. X!         tp = fpostfx(victual.piece);
  957. X! 
  958. X!         You("finish eating the %s.", singular(victual.piece));
  959. X! 
  960. X!         useup(victual.piece);
  961. X!         victual.piece = (struct obj *) 0;
  962. X!         victual.fullwarn = victual.eating = victual.doreset = 
  963. X!         victual.canchoke = FALSE;
  964. X!         return(tp);
  965. X!     }
  966. X! }
  967. X! 
  968. X! static void
  969. X! cprefx(pm)        /* called at the "first bite" of a corpse */
  970. X  register int pm;
  971. X  {
  972. X      if ((pl_character[0]=='E') ? is_elf(&mons[pm]) : is_human(&mons[pm])) {
  973. X          You("cannibal!  You will be sorry for this!");
  974. X          Aggravate_monster |= INTRINSIC;
  975. X***************
  976. X*** 71,76 ****
  977. X--- 248,293 ----
  978. X      }
  979. X  
  980. X      switch(pm) {
  981. X+         case PM_LITTLE_DOG:
  982. X+         case PM_DOG:
  983. X+         case PM_LARGE_DOG:
  984. X+         case PM_KITTEN:
  985. X+         case PM_HOUSECAT:
  986. X+         case PM_LARGE_CAT:
  987. X+         Aggravate_monster |= INTRINSIC;
  988. X+         break;
  989. X+         case PM_COCKATRICE:
  990. X+ #ifdef MEDUSA
  991. X+         case PM_MEDUSA:
  992. X+ #endif
  993. X+ #ifdef POLYSELF
  994. X+         if(!resists_ston(uasmon)) {
  995. X+ #endif
  996. X+             killer = (char *) alloc(40);
  997. X+             You("turn to stone.");
  998. X+             Sprintf(killer, "%s meat", mons[pm].mname);
  999. X+             done(STONING);
  1000. X+ #ifdef POLYSELF
  1001. X+         }
  1002. X+         break;
  1003. X+         default:
  1004. X+ 
  1005. X+         if(dmgtype(&mons[pm], AD_ACID) && Stoned) {
  1006. X+             pline("What a pity - you just destroyed a future piece of art!");
  1007. X+             Stoned = 0;
  1008. X+         }
  1009. X+ #endif
  1010. X+     }
  1011. X+     return;
  1012. X+ }
  1013. X+ 
  1014. X+ static int
  1015. X+ cpostfx(pm)        /* called after completely consuming a corpse */
  1016. X+ register int pm;
  1017. X+ {
  1018. X+     register int tmp = 0, tp = 0;
  1019. X+ 
  1020. X+     switch(pm) {
  1021. X          case PM_WRAITH:
  1022. X          pluslvl();
  1023. X          break;
  1024. X***************
  1025. X*** 89,102 ****
  1026. X          u.uhp = u.uhpmax;
  1027. X          flags.botl = 1;
  1028. X          break;
  1029. X-         case PM_LITTLE_DOG:
  1030. X-         case PM_DOG:
  1031. X-         case PM_LARGE_DOG:
  1032. X-         case PM_KITTEN:
  1033. X-         case PM_HOUSECAT:
  1034. X-         case PM_LARGE_CAT:
  1035. X-         Aggravate_monster |= INTRINSIC;
  1036. X-         break;
  1037. X          case PM_STALKER:
  1038. X          if(!Invis) {
  1039. X              HInvis = 50+rn2(100);
  1040. X--- 306,311 ----
  1041. X***************
  1042. X*** 103,109 ****
  1043. X              if(!See_invisible)
  1044. X                  newsym(u.ux, u.uy);
  1045. X          } else {
  1046. X!             if (!HInvis) You("feel hidden!");
  1047. X              HInvis |= INTRINSIC;
  1048. X              HSee_invisible |= INTRINSIC;
  1049. X          }
  1050. X--- 312,318 ----
  1051. X              if(!See_invisible)
  1052. X                  newsym(u.ux, u.uy);
  1053. X          } else {
  1054. X!             if (!(HInvis & INTRINSIC)) You("feel hidden!");
  1055. X              HInvis |= INTRINSIC;
  1056. X              HSee_invisible |= INTRINSIC;
  1057. X          }
  1058. X***************
  1059. X*** 116,137 ****
  1060. X          case PM_BAT:
  1061. X          make_stunned(HStun + 30,FALSE);
  1062. X          break;
  1063. X-         case PM_COCKATRICE:
  1064. X- #ifdef MEDUSA
  1065. X-         case PM_MEDUSA:
  1066. X- #endif
  1067. X- #ifdef POLYSELF
  1068. X-         if(!resists_ston(uasmon)) {
  1069. X- #endif
  1070. X-             killer = (char *) alloc(40);
  1071. X-             You("turn to stone.");
  1072. X-             Sprintf(killer, "%s meat",
  1073. X-                       mons[pm].mname);
  1074. X-             done(STONING);
  1075. X- #ifdef POLYSELF
  1076. X-         }
  1077. X- #endif
  1078. X-         break;
  1079. X          case PM_GIANT_MIMIC:
  1080. X          tmp += 10;
  1081. X          /* fall into next case */
  1082. X--- 325,330 ----
  1083. X***************
  1084. X*** 142,151 ****
  1085. X          tmp += 20;
  1086. X          if(u.usym == S_HUMAN) {
  1087. X              You("cannot resist the temptation to mimic a treasure chest.");
  1088. X-             tp++;
  1089. X              nomul(tmp);
  1090. X              afternmv = Meatdone;
  1091. X!             nomovemsg = "You now again prefer mimicking a human.";
  1092. X              u.usym = GOLD_SYM;
  1093. X              prme();
  1094. X          }
  1095. X--- 335,347 ----
  1096. X          tmp += 20;
  1097. X          if(u.usym == S_HUMAN) {
  1098. X              You("cannot resist the temptation to mimic a treasure chest.");
  1099. X              nomul(tmp);
  1100. X+             tp++;
  1101. X              afternmv = Meatdone;
  1102. X!             if (pl_character[0]=='E')
  1103. X!             nomovemsg = "You now again prefer mimicking an elf.";
  1104. X!             else
  1105. X!             nomovemsg = "You now again prefer mimicking a human.";
  1106. X              u.usym = GOLD_SYM;
  1107. X              prme();
  1108. X          }
  1109. X***************
  1110. X*** 179,191 ****
  1111. X              pline ("Oh wow!  Great stuff!");
  1112. X              make_hallucinated(Hallucination + 200,FALSE);
  1113. X          }
  1114. X-         if(dmgtype(ptr, AD_ACID)) {
  1115. X-           if(Stoned) {
  1116. X-             pline("What a pity - you just destroyed a future piece of art!");
  1117. X-             tp++;
  1118. X-             Stoned = 0;
  1119. X-           }
  1120. X-         }
  1121. X          if(is_giant(ptr)) gainstr((struct obj *)0, 0);
  1122. X  
  1123. X          if(can_teleport(ptr) && ptr->mlevel > rn2(10)) {
  1124. X--- 375,380 ----
  1125. X***************
  1126. X*** 242,248 ****
  1127. X  }
  1128. X  
  1129. X  static int
  1130. X! opentin(){
  1131. X      register int r;
  1132. X  
  1133. X      if(!carried(tin.tin))        /* perhaps it was stolen? */
  1134. X--- 431,437 ----
  1135. X  }
  1136. X  
  1137. X  static int
  1138. X! opentin() {        /* called during each move whilst opening a tin */
  1139. X      register int r;
  1140. X  
  1141. X      if(!carried(tin.tin))        /* perhaps it was stolen? */
  1142. X***************
  1143. X*** 278,290 ****
  1144. X          You("consume %s %s.", tintxts[r].txt,
  1145. X            mons[tin.tin->corpsenm].mname);
  1146. X          tin.tin->dknown = tin.tin->known = TRUE;
  1147. X!         (void) corpsefx(tin.tin->corpsenm);
  1148. X          /* check for vomiting added by GAN 01/16/87 */
  1149. X!         if(tintxts[r].nut < 0) {
  1150. X!         You("vomit.");
  1151. X!         vomit();
  1152. X!         morehungry(-tintxts[r].nut);
  1153. X!         } else lesshungry(tintxts[r].nut);
  1154. X          if(r == 0) {            /* Deep Fried */
  1155. X          Glib = rnd(15);
  1156. X          pline("Eating deep fried food made your %s very slippery.",
  1157. X--- 467,478 ----
  1158. X          You("consume %s %s.", tintxts[r].txt,
  1159. X            mons[tin.tin->corpsenm].mname);
  1160. X          tin.tin->dknown = tin.tin->known = TRUE;
  1161. X!         cprefx(tin.tin->corpsenm); (void) cpostfx(tin.tin->corpsenm);
  1162. X! 
  1163. X          /* check for vomiting added by GAN 01/16/87 */
  1164. X!         if(tintxts[r].nut < 0) make_vomiting((long)rn1(15,10), FALSE);
  1165. X!         else lesshungry(tintxts[r].nut);
  1166. X! 
  1167. X          if(r == 0) {            /* Deep Fried */
  1168. X          Glib = rnd(15);
  1169. X          pline("Eating deep fried food made your %s very slippery.",
  1170. X***************
  1171. X*** 306,327 ****
  1172. X      return(0);
  1173. X  }
  1174. X  
  1175. X! int
  1176. X! Hear_again()
  1177. X  {
  1178. X      flags.soundok = 1;
  1179. X      return 0;
  1180. X  }
  1181. X  
  1182. X! static void
  1183. X! rottenfood() {
  1184. X  
  1185. X      pline("Blecch!  Rotten food!");
  1186. X      if(!rn2(4)) {
  1187. X          if (Hallucination) You("feel rather trippy.");
  1188. X!         else
  1189. X!             You("feel rather %s.",
  1190. X!                 body_part(LIGHT_HEADED));
  1191. X          make_confused(HConfusion + d(2,4),FALSE);
  1192. X      } else if(!rn2(4) && !Blind) {
  1193. X          pline("Everything suddenly goes dark.");
  1194. X--- 494,568 ----
  1195. X      return(0);
  1196. X  }
  1197. X  
  1198. X! static void
  1199. X! start_tin(otmp)        /* called when starting to open a tin */
  1200. X!     register struct obj *otmp;
  1201. X  {
  1202. X+     register int tmp;
  1203. X+ 
  1204. X+     if (otmp->blessed) {
  1205. X+         pline("The tin opens like magic!");
  1206. X+         tmp = 1;
  1207. X+     } else if(uwep) {
  1208. X+         switch(uwep->otyp) {
  1209. X+         case TIN_OPENER:
  1210. X+             tmp = 1;
  1211. X+             break;
  1212. X+         case DAGGER:
  1213. X+ #ifdef TOLKIEN
  1214. X+         case ELVEN_DAGGER:
  1215. X+         case ORCISH_DAGGER:
  1216. X+ #endif
  1217. X+         case ATHAME:
  1218. X+ #ifdef WORM
  1219. X+         case CRYSKNIFE:
  1220. X+ #endif
  1221. X+             tmp = 3;
  1222. X+             break;
  1223. X+         case PICK_AXE:
  1224. X+         case AXE:
  1225. X+             tmp = 6;
  1226. X+             break;
  1227. X+         default:
  1228. X+             goto no_opener;
  1229. X+         }
  1230. X+         pline("Using your %s you try to open the tin.",
  1231. X+             aobjnam(uwep, NULL));
  1232. X+     } else {
  1233. X+ no_opener:
  1234. X+         pline("It is not so easy to open this tin.");
  1235. X+         if(Glib) {
  1236. X+             pline("The tin slips out of your hands.");
  1237. X+             if(otmp->quan > 1) {
  1238. X+                 register struct obj *obj;
  1239. X+                 obj = splitobj(otmp, 1);
  1240. X+                 if(otmp == uwep) setuwep(obj);
  1241. X+             }
  1242. X+             dropx(otmp);
  1243. X+             return;
  1244. X+         }
  1245. X+         tmp = 10 + rn2(1 + 500/((int)(ACURR(A_DEX) + ACURR(A_STR))));
  1246. X+     }
  1247. X+     tin.reqtime = tmp;
  1248. X+     tin.usedtime = 0;
  1249. X+     tin.tin = otmp;
  1250. X+     set_occupation(opentin, "opening the tin", 0);
  1251. X+     return;
  1252. X+ }
  1253. X+ 
  1254. X+ int
  1255. X+ Hear_again() {        /* called when waking up after fainting */
  1256. X      flags.soundok = 1;
  1257. X      return 0;
  1258. X  }
  1259. X  
  1260. X! static int
  1261. X! rottenfood() {        /* called on the "first bite" of rotten food */
  1262. X  
  1263. X      pline("Blecch!  Rotten food!");
  1264. X      if(!rn2(4)) {
  1265. X          if (Hallucination) You("feel rather trippy.");
  1266. X!         else You("feel rather %s.", body_part(LIGHT_HEADED));
  1267. X          make_confused(HConfusion + d(2,4),FALSE);
  1268. X      } else if(!rn2(4) && !Blind) {
  1269. X          pline("Everything suddenly goes dark.");
  1270. X***************
  1271. X*** 335,345 ****
  1272. X          nomul(-rnd(10));
  1273. X          nomovemsg = "You are conscious again.";
  1274. X          afternmv = Hear_again;
  1275. X      }
  1276. X  }
  1277. X  
  1278. X! static void
  1279. X! eatcorpse(otmp) register struct obj *otmp; {
  1280. X      register char *cname = mons[otmp->corpsenm].mname;
  1281. X      register int tp, rotted;
  1282. X  
  1283. X--- 576,590 ----
  1284. X          nomul(-rnd(10));
  1285. X          nomovemsg = "You are conscious again.";
  1286. X          afternmv = Hear_again;
  1287. X+         return(1);
  1288. X      }
  1289. X+     return(0);
  1290. X  }
  1291. X  
  1292. X! static int
  1293. X! eatcorpse(otmp)        /* called when a corpse is selected as food */
  1294. X!     register struct obj *otmp;
  1295. X! {
  1296. X      register char *cname = mons[otmp->corpsenm].mname;
  1297. X      register int tp, rotted;
  1298. X  
  1299. X***************
  1300. X*** 370,383 ****
  1301. X  #ifdef POLYSELF
  1302. X          }
  1303. X  #endif
  1304. X      } else if(poisonous(&mons[otmp->corpsenm]) && rn2(5)){
  1305. X          pline("Ecch - that must have been poisonous!");
  1306. X          if(!Poison_resistance) {
  1307. X              losestr(rnd(4));
  1308. X              losehp(rnd(15), "poisonous corpse");
  1309. X          } else    You("seem unaffected by the poison.");
  1310. X-         (void) corpsefx(otmp->corpsenm);
  1311. X-         tp++;
  1312. X      /* now any corpse left too long will make you mildly ill */
  1313. X      } else if(((rotted > 5) || ((rotted > 3) && rn2(5)))
  1314. X  #ifdef POLYSELF
  1315. X--- 615,629 ----
  1316. X  #ifdef POLYSELF
  1317. X          }
  1318. X  #endif
  1319. X+         useup(otmp);
  1320. X+         return(1);
  1321. X      } else if(poisonous(&mons[otmp->corpsenm]) && rn2(5)){
  1322. X+         tp++;
  1323. X          pline("Ecch - that must have been poisonous!");
  1324. X          if(!Poison_resistance) {
  1325. X              losestr(rnd(4));
  1326. X              losehp(rnd(15), "poisonous corpse");
  1327. X          } else    You("seem unaffected by the poison.");
  1328. X      /* now any corpse left too long will make you mildly ill */
  1329. X      } else if(((rotted > 5) || ((rotted > 3) && rn2(5)))
  1330. X  #ifdef POLYSELF
  1331. X***************
  1332. X*** 387,397 ****
  1333. X          tp++;
  1334. X          You("feel%s sick.", (Sick) ? " very" : "");
  1335. X          losehp(rnd(8), "cadaver");
  1336. X!     } else    tp = corpsefx(otmp->corpsenm);
  1337. X      if(!tp && !rn2(7)) {
  1338. X  
  1339. X!         rottenfood();
  1340. X!         lesshungry((int)mons[otmp->corpsenm].cnutrit >> 2);
  1341. X      } else {
  1342. X  #ifdef POLYSELF
  1343. X          pline("That %s corpse %s!", cname,
  1344. X--- 633,646 ----
  1345. X          tp++;
  1346. X          You("feel%s sick.", (Sick) ? " very" : "");
  1347. X          losehp(rnd(8), "cadaver");
  1348. X!     }
  1349. X      if(!tp && !rn2(7)) {
  1350. X  
  1351. X!         if(rottenfood()) {
  1352. X!         (void)touchfood(otmp);
  1353. X!         return(1);
  1354. X!         }
  1355. X!         victual.nutrit = (int)mons[otmp->corpsenm].cnutrit >> 2;
  1356. X      } else {
  1357. X  #ifdef POLYSELF
  1358. X          pline("That %s corpse %s!", cname,
  1359. X***************
  1360. X*** 399,689 ****
  1361. X  #else
  1362. X          pline("That %s corpse tasted terrible!", cname);
  1363. X  #endif
  1364. X!         lesshungry((int)mons[otmp->corpsenm].cnutrit);
  1365. X      }
  1366. X  
  1367. X      /* delay is weight dependant */
  1368. X!     multi = -(3 + (mons[otmp->corpsenm].cwt >> 2));
  1369. X  }
  1370. X  
  1371. X- /* Created by GAN 01/28/87
  1372. X-  * Amended by AKP 09/22/87: if not hard, don't choke, just vomit.
  1373. X-  * Amended by 3.  06/12/89: if not hard, sometimes choke anyway, to keep risk.
  1374. X-  */
  1375. X- /*ARGSUSED*/
  1376. X  static void
  1377. X! choke(food)
  1378. X! register struct obj *food;
  1379. X  {
  1380. X!     /* only happens if you were satiated */
  1381. X!     if(u.uhs != SATIATED) return;
  1382. X! 
  1383. X!     if (pl_character[0] == 'K' && u.ualigntyp == U_LAWFUL)
  1384. X!         u.ualign--;    /* gluttony is unchivalrous */
  1385. X! 
  1386. X! #ifndef HARD
  1387. X!     if (rn2(20)) {
  1388. X!         You("stuff yourself and then vomit voluminously.");
  1389. X!         morehungry(1000);    /* you just got *very* sick! */
  1390. X!         vomit();
  1391. X!     } else {
  1392. X! #endif
  1393. X!         if(food) {
  1394. X!             int savequan = food->quan;
  1395. X!             food->quan = 1;
  1396. X!             killer = xname(food);
  1397. X!             food->quan = savequan;
  1398. X!         } else
  1399. X!             killer = "exuberant appetite";
  1400. X!         You("choke over your food.");
  1401. X!         You("die...");
  1402. X!         done(CHOKING);
  1403. X! #ifndef HARD
  1404. X!     }
  1405. X! #endif
  1406. X  }
  1407. X  
  1408. X- int
  1409. X- doeat() {
  1410. X-     register struct obj *otmp;
  1411. X-     register struct objclass *ftmp;
  1412. X-     register int tmp;
  1413. X- 
  1414. X-     if (!(otmp = floorfood("eat", 0))) return 0;
  1415. X  
  1416. X!     if(otmp->otyp == TIN) {
  1417. X!         if (otmp->blessed) {
  1418. X!             pline("The tin opens like magic!");
  1419. X!             tmp = 1;
  1420. X!         } else if(uwep) {
  1421. X!             switch(uwep->otyp) {
  1422. X!             case TIN_OPENER:
  1423. X!                 tmp = 1;
  1424. X!                 break;
  1425. X!             case DAGGER:
  1426. X!             case ATHAME:
  1427. X! #ifdef WORM
  1428. X!             case CRYSKNIFE:
  1429. X! #endif
  1430. X!                 tmp = 3;
  1431. X!                 break;
  1432. X!             case PICK_AXE:
  1433. X!             case AXE:
  1434. X!                 tmp = 6;
  1435. X!                 break;
  1436. X!             default:
  1437. X!                 goto no_opener;
  1438. X!             }
  1439. X!             pline("Using your %s you try to open the tin.",
  1440. X!                 aobjnam(uwep, NULL));
  1441. X!         } else {
  1442. X!         no_opener:
  1443. X!             pline("It is not so easy to open this tin.");
  1444. X!             if(Glib) {
  1445. X!                 pline("The tin slips out of your hands.");
  1446. X!                 if(otmp->quan > 1) {
  1447. X!                     register struct obj *obj;
  1448. X!                     obj = splitobj(otmp, 1);
  1449. X!                     if(otmp == uwep) setuwep(obj);
  1450. X!                 }
  1451. X!                 dropx(otmp);
  1452. X!                 return(1);
  1453. X!             }
  1454. X!             tmp = 10 + rn2(1 + 500/((int)(ACURR(A_DEX) + ACURR(A_STR))));
  1455. X!         }
  1456. X!         tin.reqtime = tmp;
  1457. X!         tin.usedtime = 0;
  1458. X!         tin.tin = otmp;
  1459. X!         set_occupation(opentin, "opening the tin", 0);
  1460. X!         return(1);
  1461. X!     }
  1462. X  
  1463. X!     ftmp = &objects[otmp->otyp];
  1464. X!     multi = -ftmp->oc_delay;
  1465. X!     if(otmp->otyp == CORPSE) eatcorpse(otmp);
  1466. X!     else {
  1467. X!         if (otmp->otyp != FORTUNE_COOKIE &&
  1468. X!         otmp->otyp != DEAD_LIZARD &&
  1469. X!         (otmp->cursed ||
  1470. X!          ((monstermoves - otmp->age) > otmp->blessed ? 50 : 30)) &&
  1471. X!           !rn2(7)) {
  1472. X  
  1473. X!         rottenfood();
  1474. X!         lesshungry(ftmp->nutrition >> 2);
  1475. X!         } else {
  1476. X!         if(u.uhunger >= 1500) choke(otmp);
  1477. X! 
  1478. X!         switch(otmp->otyp){
  1479. X!         case FOOD_RATION:
  1480. X!             if(u.uhunger <= 200)
  1481. X!                 if (Hallucination)
  1482. X!                 pline("Oh wow, like, superior, man!");
  1483. X!                 else
  1484. X!                 pline("That food really hit the spot!");
  1485. X!             else if(u.uhunger <= 700)
  1486. X!                 pline("That satiated your stomach!");
  1487. X!     /* Have lesshungry() report when you are nearly full so all eating
  1488. X!      * warns when you are about to choke.
  1489. X!      */
  1490. X!             lesshungry(ftmp->nutrition);
  1491. X!             if(multi < 0) nomovemsg = "You finished your meal.";
  1492. X!             break;
  1493. X!         case TRIPE_RATION:
  1494. X  #ifdef POLYSELF
  1495. X!             if (carnivorous(uasmon))
  1496. X!                 pline("That tripe ration was surprisingly good!");
  1497. X!             else {
  1498. X  #endif
  1499. X!                 pline("Yak - dog food!");
  1500. X!                 more_experienced(1,0);
  1501. X!                 flags.botl = 1;
  1502. X  #ifdef POLYSELF
  1503. X!             }
  1504. X! #endif
  1505. X!             if(rn2(2)
  1506. X  #ifdef POLYSELF
  1507. X!                 && !carnivorous(uasmon)
  1508. X! #endif
  1509. X!                             ){
  1510. X!                 You("vomit.");
  1511. X!                 morehungry(20);
  1512. X!                 vomit();
  1513. X!             } else    lesshungry(ftmp->nutrition);
  1514. X              break;
  1515. X! #ifdef POLYSELF
  1516. X!         case CLOVE_OF_GARLIC:
  1517. X!             if (is_undead(uasmon)) {
  1518. X!                 You("cannot stand eating it.  You vomit.");
  1519. X!                 vomit();
  1520. X!                 break;
  1521. X!             }
  1522. X!             /* Fall through otherwise */
  1523. X  #endif
  1524. X!         default:
  1525. X  #ifdef TUTTI_FRUTTI
  1526. X!             if (otmp->otyp==SLIME_MOLD && !otmp->cursed
  1527. X!                 && otmp->spe == current_fruit
  1528. X!                                 )
  1529. X!                 pline(!Hallucination ?
  1530. X!                     "Mmm!  Your favorite!" :
  1531. X!                     "Yum!  Your fave fruit!");
  1532. X!             else
  1533. X  #endif
  1534. X  #ifdef UNIX
  1535. X!             if (otmp->otyp == APPLE || otmp->otyp == PEAR) {
  1536. X!                 if (!Hallucination)
  1537. X!                 pline("Core dumped.");
  1538. X!                 else {
  1539. X!     /* This is based on an old Usenet joke, a fake a.out manual page */
  1540. X!                 int x = rnd(100);
  1541. X!                 if (x <= 75)
  1542. X!                     pline("Segmentation fault -- core dumped.");
  1543. X!                 else if (x <= 99)
  1544. X!                     pline("Bus error -- core dumped.");
  1545. X!                 else pline("Yo' mama -- core dumped.");
  1546. X!                 }
  1547. X!             } else
  1548. X! #endif
  1549. X!             {
  1550. X!                 int oldquan = otmp->quan;
  1551. X!                 otmp->quan = 1;
  1552. X!                 pline("That %s was %s!", xname(otmp),
  1553. X!                   otmp->cursed ?
  1554. X!                 (Hallucination ? "grody" : "terrible"):
  1555. X!                   Hallucination ? "gnarly" : (
  1556. X  #ifdef TOLKIEN
  1557. X!                    otmp->otyp==CRAM_RATION ? "bland":
  1558. X  #endif
  1559. X!                    "delicious"));
  1560. X!                 otmp->quan = oldquan;
  1561. X!             }
  1562. X!             lesshungry(ftmp->nutrition);
  1563. X  
  1564. X!             switch(otmp->otyp) {
  1565. X  #ifdef POLYSELF
  1566. X!                 case CLOVE_OF_GARLIC:
  1567. X!                 if (u.ulycn != -1) {
  1568. X!                     You("feel purified.");
  1569. X!                     if(uasmon == &mons[u.ulycn] &&
  1570. X!                       !Polymorph_control)
  1571. X!                         rehumanize();
  1572. X!                     u.ulycn = -1;
  1573. X!                 }
  1574. X!                 break;
  1575. X! #endif
  1576. X!                 case DEAD_LIZARD:
  1577. X!                 /* Relief from cockatrices -dgk */
  1578. X!                 if (Stoned) {
  1579. X!                     Stoned = 0;
  1580. X!                     You("feel limber!");
  1581. X!                 }
  1582. X!                 if (HStun > 2)  make_stunned(2L,FALSE);
  1583. X!                 if (HConfusion > 2)  make_confused(2L,FALSE);
  1584. X!                 break;
  1585. X!                 case CARROT:
  1586. X!                 make_blinded(0L,TRUE);
  1587. X!                 break;
  1588. X!                 case FORTUNE_COOKIE:
  1589. X!                 outrumor(bcsign(otmp), TRUE);
  1590. X!                 break;
  1591. X!                 case LUMP_OF_ROYAL_JELLY:
  1592. X!                 /* This stuff seems to be VERY healthy! */
  1593. X!                 gainstr(otmp, 1);
  1594. X!                 u.uhp += (otmp->cursed) ? -rnd(20) : rnd(20);
  1595. X!                 if(u.uhp > u.uhpmax) {
  1596. X!                     if(!rn2(17)) u.uhpmax++;
  1597. X!                     u.uhp = u.uhpmax;
  1598. X!                 } else if(u.uhp <= 0) {
  1599. X!                     killer = "rotten jelly lump";
  1600. X!                     done(POISONING);
  1601. X!                 }
  1602. X!                 if(!otmp->cursed) heal_legs();
  1603. X!                 break;
  1604. X!                 case EGG:
  1605. X!                 if(otmp->corpsenm == PM_COCKATRICE) {
  1606. X! #ifdef POLYSELF
  1607. X!                     if(!resists_ston(uasmon)) {
  1608. X! #endif
  1609. X!                     if (!Stoned) Stoned = 5;
  1610. X!                     killer = "cockatrice egg";
  1611. X! #ifdef POLYSELF
  1612. X!                     }
  1613. X! #endif
  1614. X!                 }
  1615. X!                 break;
  1616. X!                 default:    break;
  1617. X!             }
  1618. X!             break;
  1619. X!         }
  1620. X!         }
  1621. X      }
  1622. X!     
  1623. X  
  1624. X!     if(multi < 0 && !nomovemsg){
  1625. X! #ifdef LINT    /* JAR        static char msgbuf[BUFSZ]; */
  1626. X!         char msgbuf[BUFSZ];
  1627. X! #else
  1628. X!         static char msgbuf[BUFSZ];
  1629. X! #endif
  1630. X!         /* note: ftmp->oc_name usually works, the exception being
  1631. X!          * for fruits.  If fruits are changed to take more time to
  1632. X!          * eat, this has to be modified.
  1633. X!          */
  1634. X!         if (otmp->otyp != CORPSE)
  1635. X!             Sprintf(msgbuf, "You finish eating the %s.",
  1636. X!                         ftmp->oc_name);
  1637. X!         else
  1638. X!             Sprintf(msgbuf, "You finish eating the %s corpse.",
  1639. X!                         mons[otmp->corpsenm].mname);
  1640. X!         nomovemsg = msgbuf;
  1641. X      }
  1642. X!     useup(otmp);
  1643. X      return(1);
  1644. X  }
  1645. X  
  1646. X- /* called in main.c */
  1647. X  void
  1648. X! gethungry(){
  1649. X      --u.uhunger;
  1650. X      if(moves % 2) {
  1651. X          if(HRegeneration) u.uhunger--;
  1652. X--- 648,908 ----
  1653. X  #else
  1654. X          pline("That %s corpse tasted terrible!", cname);
  1655. X  #endif
  1656. X!         victual.nutrit = (int)mons[otmp->corpsenm].cnutrit;
  1657. X      }
  1658. X  
  1659. X      /* delay is weight dependant */
  1660. X!     victual.reqtime = 3 + (mons[otmp->corpsenm].cwt >> 2);
  1661. X!     return(0);
  1662. X  }
  1663. X  
  1664. X  static void
  1665. X! start_eating(otmp)        /* called as you start to eat */
  1666. X!     register struct obj *otmp;
  1667. X  {
  1668. X! #ifdef DEBUG
  1669. X!     pline("start_eating: %x (victual = %x)", otmp, victual.piece);
  1670. X!     pline("reqtime = %d", victual.reqtime);
  1671. X!     pline("nutrit = %d", victual.nutrit);
  1672. X!     pline("nmod = %d", victual.nmod);
  1673. X! #endif
  1674. X!     victual.fullwarn = victual.doreset = FALSE;
  1675. X!     victual.canchoke = (u.uhs == SATIATED);
  1676. X!     victual.eating = TRUE;
  1677. X! 
  1678. X!     if (otmp->otyp == CORPSE)
  1679. X!         cprefx(victual.piece->corpsenm);
  1680. X! 
  1681. X!     Sprintf(msgbuf, "eating the %s", singular(otmp));
  1682. X!     set_occupation(eatfood, msgbuf, 0);
  1683. X  }
  1684. X  
  1685. X  
  1686. X! static void
  1687. X! fprefx(otmp)        /* called on "first bite" of (non-corpse) food */
  1688. X  
  1689. X!     register struct obj *otmp;
  1690. X! {
  1691. X!     switch(otmp->otyp) {
  1692. X  
  1693. X!         case FOOD_RATION:
  1694. X!         if(u.uhunger <= 200)
  1695. X!             if (Hallucination) pline("Oh wow, like, superior, man!");
  1696. X!             else           pline("That food really hit the spot!");
  1697. X!         else if(u.uhunger <= 700) pline("That satiated your stomach!");
  1698. X!         break;
  1699. X!         case TRIPE_RATION:
  1700. X  #ifdef POLYSELF
  1701. X!         if (carnivorous(uasmon))
  1702. X!             pline("That tripe ration was surprisingly good!");
  1703. X!         else {
  1704. X  #endif
  1705. X!             pline("Yak - dog food!");
  1706. X!             more_experienced(1,0);
  1707. X!             flags.botl = 1;
  1708. X  #ifdef POLYSELF
  1709. X!         }
  1710. X! #endif
  1711. X!         if(rn2(2)
  1712. X! #ifdef POLYSELF
  1713. X!             && !carnivorous(uasmon)
  1714. X! #endif
  1715. X!                         ) {
  1716. X!             make_vomiting((long)rn1(victual.reqtime, 10), FALSE);
  1717. X!         }
  1718. X!         break;
  1719. X!         case DEAD_LIZARD:
  1720. X!         /* Relief from cockatrices -dgk */
  1721. X!         if (Stoned) {
  1722. X!             Stoned = 0;
  1723. X!             You("feel limber!");
  1724. X!         }
  1725. X!         break;
  1726. X  #ifdef POLYSELF
  1727. X!         case CLOVE_OF_GARLIC:
  1728. X!         if (is_undead(uasmon)) {
  1729. X!             make_vomiting((long)rn1(victual.reqtime, 5), FALSE);
  1730. X              break;
  1731. X!         }
  1732. X!         /* Fall through otherwise */
  1733. X  #endif
  1734. X!         default:
  1735. X  #ifdef TUTTI_FRUTTI
  1736. X!         if (otmp->otyp==SLIME_MOLD && !otmp->cursed
  1737. X!             && otmp->spe == current_fruit)
  1738. X!             pline(!Hallucination ? "Mmm!  Your favorite!" :
  1739. X!                            "Yum!  Your fave fruit!");
  1740. X!         else
  1741. X  #endif
  1742. X  #ifdef UNIX
  1743. X!         if (otmp->otyp == APPLE || otmp->otyp == PEAR) {
  1744. X!             if (!Hallucination) pline("Core dumped.");
  1745. X!             else {
  1746. X! /* This is based on an old Usenet joke, a fake a.out manual page */
  1747. X!             int x = rnd(100);
  1748. X!             if (x <= 75)
  1749. X!                 pline("Segmentation fault -- core dumped.");
  1750. X!             else if (x <= 99)
  1751. X!                 pline("Bus error -- core dumped.");
  1752. X!             else pline("Yo' mama -- core dumped.");
  1753. X!             }
  1754. X!         } else 
  1755. X! #endif
  1756. X!         {
  1757. X!             int oldquan = otmp->quan;
  1758. X!             otmp->quan = 1;
  1759. X!             pline("This %s is %s!", xname(otmp),
  1760. X!               otmp->cursed ? (Hallucination ? "grody" : "terrible"):
  1761. X!               Hallucination ? "gnarly" : (
  1762. X  #ifdef TOLKIEN
  1763. X!                otmp->otyp==CRAM_RATION ? "bland":
  1764. X  #endif
  1765. X!                "delicious"));
  1766. X!             otmp->quan = oldquan;
  1767. X!         }
  1768. X!         break;
  1769. X!     }
  1770. X! }
  1771. X! 
  1772. X! static int
  1773. X! fpostfx(otmp)        /* called after consuming (non-corpse) food */
  1774. X  
  1775. X!     register struct obj *otmp;
  1776. X! {
  1777. X!     switch(otmp->otyp) {
  1778. X  #ifdef POLYSELF
  1779. X!         case CLOVE_OF_GARLIC:
  1780. X!         if (u.ulycn != -1) {
  1781. X!             u.ulycn = -1;
  1782. X!             You("feel purified.");
  1783. X!             if(uasmon == &mons[u.ulycn] && !Polymorph_control)
  1784. X!             rehumanize();
  1785. X!         }
  1786. X!         break;
  1787. X! #endif
  1788. X!         case DEAD_LIZARD:
  1789. X!         if (HStun > 2)  make_stunned(2L,FALSE);
  1790. X!         if (HConfusion > 2)  make_confused(2L,FALSE);
  1791. X!         break;
  1792. X!         case CARROT:
  1793. X!         make_blinded(0L,TRUE);
  1794. X!         break;
  1795. X!         case FORTUNE_COOKIE:
  1796. X!         outrumor(bcsign(otmp), TRUE);
  1797. X!         break;
  1798. X!         case LUMP_OF_ROYAL_JELLY:
  1799. X!         /* This stuff seems to be VERY healthy! */
  1800. X!         gainstr(otmp, 1);
  1801. X!         u.uhp += (otmp->cursed) ? -rnd(20) : rnd(20);
  1802. X!         if(u.uhp > u.uhpmax) {
  1803. X!             if(!rn2(17)) u.uhpmax++;
  1804. X!             u.uhp = u.uhpmax;
  1805. X!         } else if(u.uhp <= 0) {
  1806. X!             killer = "rotten jelly lump";
  1807. X!             done(POISONING);
  1808. X!         }
  1809. X!         if(!otmp->cursed) heal_legs();
  1810. X!         break;
  1811. X!         case EGG:
  1812. X!         if(otmp->corpsenm == PM_COCKATRICE) {
  1813. X! #ifdef POLYSELF
  1814. X!             if(!resists_ston(uasmon)) {
  1815. X! #endif
  1816. X!             if (!Stoned) Stoned = 5;
  1817. X!             killer = "cockatrice egg";
  1818. X! #ifdef POLYSELF
  1819. X!             }
  1820. X! #endif
  1821. X!         }
  1822. X!         break;
  1823. X      }
  1824. X!     return(0);    /* must do this for sync with cpostfx() */
  1825. X! }
  1826. X  
  1827. X! int
  1828. X! doeat() {        /* generic "eat" command funtion (see cmd.c) */
  1829. X!     register struct obj *otmp;
  1830. X! 
  1831. X!     if(victual.piece &&
  1832. X!        (carried(victual.piece) ||
  1833. X!         (victual.piece->ox == u.ux && victual.piece->oy == u.uy))) {
  1834. X! 
  1835. X!         You("resume your meal.");
  1836. X!         if(!carried(victual.piece)) {
  1837. X!         if(victual.piece->quan != 1)
  1838. X!             (void) splitobj(victual.piece, 1);
  1839. X!         victual.piece = pick_obj(victual.piece);
  1840. X!         }
  1841. X!         start_eating(victual.piece);
  1842. X!         return(1);
  1843. X!     }
  1844. X! 
  1845. X!     /* nothing in progress - so try to find something. */
  1846. X!     if (!(otmp = floorfood("eat", 0))) return 0;
  1847. X! 
  1848. X!     /* tins are a special case */
  1849. X!     if(otmp->otyp == TIN) {
  1850. X!         start_tin(otmp);
  1851. X!         return(1);
  1852. X      }
  1853. X! 
  1854. X!     /* Now we need to calculate delay and nutritional info.
  1855. X!      * The base nutrition calculated here and in eatcorpse() accounts
  1856. X!      * for normal vs. rotten food.  The reqtime and nutrit values are
  1857. X!      * then adjusted in accordance with the amount of food left.
  1858. X!      */
  1859. X!     if(otmp->otyp == CORPSE) {
  1860. X!         if(eatcorpse(otmp)) return(1);
  1861. X!         /* else eatcorpse sets up reqtime and nutrit */
  1862. X!     } else {
  1863. X!         victual.reqtime = objects[otmp->otyp].oc_delay;
  1864. X!         victual.nutrit = objects[otmp->otyp].nutrition;
  1865. X!         if (otmp->otyp != FORTUNE_COOKIE && otmp->otyp != DEAD_LIZARD &&
  1866. X!         (otmp->cursed ||
  1867. X!          ((monstermoves - otmp->age) > otmp->blessed ? 50 : 30)) &&
  1868. X!         !rn2(7)) {
  1869. X! 
  1870. X!         if(rottenfood()) {
  1871. X!             (void)touchfood(otmp);
  1872. X!             return(1);
  1873. X!         }
  1874. X!         victual.nutrit /= 2;
  1875. X!         } else fprefx(otmp);
  1876. X!     }
  1877. X! 
  1878. X!     victual.piece = otmp;
  1879. X!     victual.usedtime = 0;
  1880. X! 
  1881. X!     /* re-calc the nutrition (already set) to account for weight */
  1882. X!     if(otmp->oeaten) {
  1883. X!         int baseweight = weight(otmp);    /* weight of full item */
  1884. X! 
  1885. X!         victual.reqtime = 
  1886. X!         rounddiv((int)(victual.reqtime * otmp->owt), baseweight);
  1887. X!         victual.nutrit = 
  1888. X!         rounddiv((int)(victual.nutrit * otmp->owt), baseweight);
  1889. X!     }
  1890. X! 
  1891. X!     /* calculate the modulo value (nutrit. units per round eating)
  1892. X!      * note: this isn't exact - you actually lose a little nutrition
  1893. X!      *     due to this method.
  1894. X!      * TODO: add in a "remainder" value to be given at the end of the
  1895. X!      *     meal.
  1896. X!      */
  1897. X!     if(victual.nutrit == 0 || victual.reqtime == 0)
  1898. X!         /* possible if most has been eaten before */
  1899. X!         victual.nmod = 0;
  1900. X!     else if(victual.nutrit > victual.reqtime)
  1901. X!         victual.nmod = -(victual.nutrit / victual.reqtime);
  1902. X!     else
  1903. X!         victual.nmod = victual.reqtime % victual.nutrit;
  1904. X! 
  1905. X!     start_eating(otmp);
  1906. X      return(1);
  1907. X  }
  1908. X  
  1909. X  void
  1910. X! gethungry() {        /* as time goes by - called in main.c */
  1911. X      --u.uhunger;
  1912. X      if(moves % 2) {
  1913. X          if(HRegeneration) u.uhunger--;
  1914. X***************
  1915. X*** 704,712 ****
  1916. X      newuhs(TRUE);
  1917. X  }
  1918. X  
  1919. X! /* called after vomiting and after performing feats of magic */
  1920. X  void
  1921. X! morehungry(num)
  1922. X  register int num;
  1923. X  {
  1924. X      u.uhunger -= num;
  1925. X--- 923,931 ----
  1926. X      newuhs(TRUE);
  1927. X  }
  1928. X  
  1929. X! 
  1930. X  void
  1931. X! morehungry(num)    /* called after vomiting and after performing feats of magic */
  1932. X  register int num;
  1933. X  {
  1934. X      u.uhunger -= num;
  1935. X***************
  1936. X*** 713,733 ****
  1937. X      newuhs(TRUE);
  1938. X  }
  1939. X  
  1940. X! /* called after eating something (and after drinking fruit juice) */
  1941. X  void
  1942. X! lesshungry(num)
  1943. X  register int num;
  1944. X  {
  1945. X      u.uhunger += num;
  1946. X!     if(u.uhunger >= 2000) choke((struct obj *) 0);
  1947. X!     else {
  1948. X          /* Have lesshungry() report when you're nearly full so all eating
  1949. X           * warns when you're about to choke.
  1950. X           */
  1951. X          if (u.uhunger >= 1500) {
  1952. X          pline("You're having a hard time getting all of it down.");
  1953. X-         multi -= 2;
  1954. X          nomovemsg = "You're finally finished.";
  1955. X          }
  1956. X      }
  1957. X      newuhs(FALSE);
  1958. X--- 932,967 ----
  1959. X      newuhs(TRUE);
  1960. X  }
  1961. X  
  1962. X! 
  1963. X  void
  1964. X! lesshungry(num)    /* called after eating (and after drinking fruit juice) */
  1965. X  register int num;
  1966. X  {
  1967. X+ #ifdef DEBUG
  1968. X+     pline("lesshungry(%d)", num);
  1969. X+ #endif
  1970. X      u.uhunger += num;
  1971. X!     if(u.uhunger >= 2000) {
  1972. X!         if (!victual.eating || victual.canchoke)
  1973. X!         choke((struct obj *) 0);
  1974. X!     } else {
  1975. X          /* Have lesshungry() report when you're nearly full so all eating
  1976. X           * warns when you're about to choke.
  1977. X           */
  1978. X          if (u.uhunger >= 1500) {
  1979. X+           if(!victual.eating || (victual.eating && !victual.fullwarn)) {
  1980. X          pline("You're having a hard time getting all of it down.");
  1981. X          nomovemsg = "You're finally finished.";
  1982. X+         if(!victual.eating)
  1983. X+             multi = -2;
  1984. X+         else {
  1985. X+             victual.fullwarn = TRUE;
  1986. X+             if (victual.canchoke) {
  1987. X+             pline("Stop eating?");
  1988. X+             if(yn() == 'y') reset_eat();
  1989. X+             }
  1990. X+         }
  1991. X+           }
  1992. X          }
  1993. X      }
  1994. X      newuhs(FALSE);
  1995. X***************
  1996. X*** 742,748 ****
  1997. X  }
  1998. X  
  1999. X  void
  2000. X! newuhs(incr) boolean incr; {
  2001. X      register int newhs, h = u.uhunger;
  2002. X  
  2003. X      newhs = (h > 1000) ? SATIATED :
  2004. X--- 976,984 ----
  2005. X  }
  2006. X  
  2007. X  void
  2008. X! newuhs(incr)        /* compute and comment on your (new?) hunger status */
  2009. X!     boolean incr;
  2010. X! {
  2011. X      register int newhs, h = u.uhunger;
  2012. X  
  2013. X      newhs = (h > 1000) ? SATIATED :
  2014. X***************
  2015. X*** 792,798 ****
  2016. X              if (Hallucination)
  2017. X                  pline((!incr) ?
  2018. X                    "You still have the munchies." :
  2019. X!                   "The munchies are starting to interfere with your motor capabilities.");
  2020. X              else
  2021. X                  You((!incr) ? "feel weak now." :
  2022. X                    (u.uhunger < 45) ? "feel weak." :
  2023. X--- 1028,1034 ----
  2024. X              if (Hallucination)
  2025. X                  pline((!incr) ?
  2026. X                    "You still have the munchies." :
  2027. X!       "The munchies are starting to interfere with your motor capabilities.");
  2028. X              else
  2029. X                  You((!incr) ? "feel weak now." :
  2030. X                    (u.uhunger < 45) ? "feel weak." :
  2031. X***************
  2032. X*** 810,827 ****
  2033. X  }
  2034. X  
  2035. X  struct obj *
  2036. X! floorfood(verb,corpseonly)
  2037. X! char *verb;
  2038. X! boolean corpseonly;
  2039. X  {
  2040. X      register struct obj *otmp;
  2041. X  
  2042. X      /* Is there some food (probably a heavy corpse) here on the ground? */
  2043. X      if(!Levitation && !u.uswallow) {
  2044. X!     if(OBJ_AT(u.ux, u.uy))
  2045. X!         for(otmp = fobj; otmp; otmp = otmp->nobj) {
  2046. X!         if(otmp->ox == u.ux && otmp->oy == u.uy &&
  2047. X!            (corpseonly ? otmp->otyp==CORPSE : otmp->olet==FOOD_SYM)) {
  2048. X              pline("There %s %s here; %s %s? ",
  2049. X                  (otmp->quan == 1) ? "is" : "are",
  2050. X                  doname(otmp), verb,
  2051. X--- 1046,1061 ----
  2052. X  }
  2053. X  
  2054. X  struct obj *
  2055. X! floorfood(verb,corpseonly)    /* get food from floor or pack */
  2056. X!     char *verb;
  2057. X!     boolean corpseonly;
  2058. X  {
  2059. X      register struct obj *otmp;
  2060. X  
  2061. X      /* Is there some food (probably a heavy corpse) here on the ground? */
  2062. X      if(!Levitation && !u.uswallow) {
  2063. X!         for(otmp = level.objects[u.ux][u.uy]; otmp; otmp = otmp->nexthere) {
  2064. X!         if(corpseonly ? otmp->otyp==CORPSE : otmp->olet==FOOD_SYM) {
  2065. X              pline("There %s %s here; %s %s? ",
  2066. X                  (otmp->quan == 1) ? "is" : "are",
  2067. X                  doname(otmp), verb,
  2068. X***************
  2069. X*** 829,839 ****
  2070. X              if(yn() == 'y') {
  2071. X                  if(otmp->quan != 1)
  2072. X                      (void) splitobj(otmp, 1);
  2073. X!                 freeobj(otmp);
  2074. X!                 otmp = addinv(otmp);
  2075. X!                 addtobill(otmp, TRUE);
  2076. X!                 if(Invisible) newsym(u.ux, u.uy);
  2077. X!                 return otmp;
  2078. X              }
  2079. X          }
  2080. X          }
  2081. X--- 1063,1069 ----
  2082. X              if(yn() == 'y') {
  2083. X                  if(otmp->quan != 1)
  2084. X                      (void) splitobj(otmp, 1);
  2085. X!                 return(pick_obj(otmp));
  2086. X              }
  2087. X          }
  2088. X          }
  2089. X***************
  2090. X*** 842,849 ****
  2091. X  }
  2092. X  
  2093. X  /* Side effects of vomiting */
  2094. X  /* TO DO: regurgitate swallowed monsters when poly'd */
  2095. X  void
  2096. X! vomit() { /* A good idea from David Neves */
  2097. X      make_sick(0L,TRUE);
  2098. X  }
  2099. X--- 1072,1081 ----
  2100. X  }
  2101. X  
  2102. X  /* Side effects of vomiting */
  2103. X+ /* added nomul (MRS) - it makes sense, you're too busy being sick! */
  2104. X  /* TO DO: regurgitate swallowed monsters when poly'd */
  2105. X  void
  2106. X! vomit() {        /* A good idea from David Neves */
  2107. X      make_sick(0L,TRUE);
  2108. X+     nomul(-2);
  2109. X  }
  2110. X*** src/Old/end.c    Sun Oct 15 18:34:53 1989
  2111. X--- src/end.c    Sun Oct 15 17:25:26 1989
  2112. X***************
  2113. X*** 158,163 ****
  2114. X--- 158,168 ----
  2115. X  panic VA_DECL(char *, str)
  2116. X      VA_START(str);
  2117. X      VA_INIT(str, char *);
  2118. X+ #ifdef MACOS
  2119. X+     puts(str);
  2120. X+     more();
  2121. X+ #endif
  2122. X+ 
  2123. X      if(panicking++)
  2124. X  #ifdef SYSV
  2125. X          (void)
  2126. X***************
  2127. X*** 185,191 ****
  2128. X--- 190,200 ----
  2129. X      hu = FALSE;
  2130. X      (void) dosave0();
  2131. X  #endif
  2132. X+ #ifdef MACOS
  2133. X+     puts(" ERROR:  ");
  2134. X+ #else
  2135. X      (void) fputs(" ERROR:  ", stdout);
  2136. X+ #endif
  2137. X      Vprintf(str,VA_ARGS);
  2138. X      more();                /* contains a fflush() */
  2139. X  #if defined(WIZARD) && (defined(UNIX) || defined(VMS))
  2140. X***************
  2141. X*** 234,240 ****
  2142. X                !Blind ? "begins to glow" : "feels warm");
  2143. X          You("feel much better!");
  2144. X          pline("The medallion crumbles to dust!");
  2145. X!         useup(uamul);
  2146. X          if (u.uhunger < 500) u.uhunger = 500;
  2147. X          nomovemsg = "You survived that attempt on your life.";
  2148. X          curs_on_u();
  2149. X--- 243,254 ----
  2150. X                !Blind ? "begins to glow" : "feels warm");
  2151. X          You("feel much better!");
  2152. X          pline("The medallion crumbles to dust!");
  2153. X!         if (uamul)    /* Huss:  Check if amulet really is worn */
  2154. X!             useup(uamul);
  2155. X!         else if (uwep && uwep->otyp == AMULET_OF_LIFE_SAVING)
  2156. X!             useup(uwep);    /* Oops, he must be wielding it. */
  2157. X!         else
  2158. X!             impossible("Using an amulet without having it?");
  2159. X          if (u.uhunger < 500) u.uhunger = 500;
  2160. X          nomovemsg = "You survived that attempt on your life.";
  2161. X          curs_on_u();
  2162. X***************
  2163. X*** 281,287 ****
  2164. X      else if(how == STONED)
  2165. X          (mk_named_object(STATUE, upmon, u.ux, u.uy, plname,
  2166. X                      strlen(plname)))->spe = 0;
  2167. X!     else
  2168. X          (void) mk_named_object(CORPSE, upmon, u.ux, u.uy, plname,
  2169. X                              strlen(plname));
  2170. X  
  2171. X--- 295,304 ----
  2172. X      else if(how == STONED)
  2173. X          (mk_named_object(STATUE, upmon, u.ux, u.uy, plname,
  2174. X                      strlen(plname)))->spe = 0;
  2175. X! /*
  2176. X!  * If you're burned to a crisp, why leave a corpse?
  2177. X!  */
  2178. X!     else if (how != BURNING)
  2179. X          (void) mk_named_object(CORPSE, upmon, u.ux, u.uy, plname,
  2180. X                              strlen(plname));
  2181. X  
  2182. X***************
  2183. X*** 468,474 ****
  2184. X          topten();
  2185. X  /* "So when I die, the first thing I will see in Heaven is a score list?" */
  2186. X      if(done_stopprint) Printf("\n\n");
  2187. X! #ifdef APOLLO
  2188. X      getret();
  2189. X  #endif
  2190. X      exit(0);
  2191. X--- 485,491 ----
  2192. X          topten();
  2193. X  /* "So when I die, the first thing I will see in Heaven is a score list?" */
  2194. X      if(done_stopprint) Printf("\n\n");
  2195. X! #if defined(APOLLO) || defined(MACOS)
  2196. X      getret();
  2197. X  #endif
  2198. X      exit(0);
  2199. X***************
  2200. X*** 481,496 ****
  2201. X      if (ramdisk)
  2202. X          eraseall(permbones, alllevels);
  2203. X  #else
  2204. X! #if defined(UNIX) || (defined(MSDOS) && !defined(OLD_TOS)) || defined(VMS)
  2205. X      register int x;
  2206. X! #if defined(UNIX) || defined(VMS)
  2207. X      (void) signal(SIGHUP,SIG_IGN);
  2208. X! #endif
  2209. X      for(x = maxdlevel; x >= 0; x--) {
  2210. X          glo(x);
  2211. X          (void) unlink(lock);    /* not all levels need be present */
  2212. X      }
  2213. X! #endif
  2214. X  #endif
  2215. X  }
  2216. X  
  2217. X--- 498,514 ----
  2218. X      if (ramdisk)
  2219. X          eraseall(permbones, alllevels);
  2220. X  #else
  2221. X! # if defined(UNIX) || (defined(MSDOS) && !defined(OLD_TOS)) || defined(VMS) \
  2222. X!                             || defined(MACOS)
  2223. X      register int x;
  2224. X! #  if defined(UNIX) || defined(VMS)
  2225. X      (void) signal(SIGHUP,SIG_IGN);
  2226. X! #  endif
  2227. X      for(x = maxdlevel; x >= 0; x--) {
  2228. X          glo(x);
  2229. X          (void) unlink(lock);    /* not all levels need be present */
  2230. X      }
  2231. X! # endif
  2232. X  #endif
  2233. X  }
  2234. X  
  2235. X*** src/Old/invent.c    Sun Oct 15 18:37:27 1989
  2236. X--- src/invent.c    Thu Oct  5 21:18:12 1989
  2237. X***************
  2238. X*** 140,145 ****
  2239. X--- 140,146 ----
  2240. X  register struct obj *obj;
  2241. X  {
  2242. X      if(obj->quan > 1){
  2243. X+         obj->in_use = FALSE;    /* no longer in use */
  2244. X          obj->quan--;
  2245. X          obj->owt = weight(obj);
  2246. X      } else {
  2247. X***************
  2248. X*** 1096,1102 ****
  2249. X      else if((obj->olet==WEAPON_SYM || obj->olet==ARMOR_SYM) &&
  2250. X          obj->rustfree != otmp->rustfree) return FALSE;
  2251. X  
  2252. X!     else if(obj->olet == FOOD_SYM && OEATEN(obj) != OEATEN(otmp))
  2253. X          return(FALSE);
  2254. X  
  2255. X      else if(obj->otyp == CORPSE || obj->otyp == EGG || obj->otyp == TIN)
  2256. X--- 1097,1103 ----
  2257. X      else if((obj->olet==WEAPON_SYM || obj->olet==ARMOR_SYM) &&
  2258. X          obj->rustfree != otmp->rustfree) return FALSE;
  2259. X  
  2260. X!     else if(obj->olet == FOOD_SYM && obj->oeaten != otmp->oeaten)
  2261. X          return(FALSE);
  2262. X  
  2263. X      else if(obj->otyp == CORPSE || obj->otyp == EGG || obj->otyp == TIN)
  2264. X
  2265. END_OF_FILE
  2266. if test 56241 -ne `wc -c <'patches05d'`; then
  2267.     echo shar: \"'patches05d'\" unpacked with wrong size!
  2268. fi
  2269. # end of 'patches05d'
  2270. fi
  2271. echo shar: End of archive 4 \(of 6\).
  2272. cp /dev/null ark4isdone
  2273. MISSING=""
  2274. for I in 1 2 3 4 5 6 ; do
  2275.     if test ! -f ark${I}isdone ; then
  2276.     MISSING="${MISSING} ${I}"
  2277.     fi
  2278. done
  2279. if test "${MISSING}" = "" ; then
  2280.     echo You have unpacked all 6 archives.
  2281.     rm -f ark[1-9]isdone
  2282. else
  2283.     echo You still need to unpack the following archives:
  2284.     echo "        " ${MISSING}
  2285. fi
  2286. ##  End of shell archive.
  2287. exit 0
  2288.